package org.crmsystem.service.impl;

import java.util.ArrayList;
import java.util.HashMap;

import org.crmsystem.dao.IContactMapper;
import org.crmsystem.model.Contact;
import org.crmsystem.service.IContactService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ContactServiceImpl implements IContactService{
	@Autowired
	private IContactMapper iContactMapper;

	@Override
	public int addContact(Contact contact) {
		return iContactMapper.addContact(contact);
	}

	@Override
	public int delContact(int contactId) {
		return iContactMapper.delContact(contactId);
	}

	@Override
	public int updateContact(Contact contact) {
		return iContactMapper.updateContact(contact);
	}

	@Override
	public ArrayList<Contact> selectContactList(HashMap<String, Object> searchMap) {
		return iContactMapper.selectContactList(searchMap);
	}


	@Override
	public Integer getIdByName(String name) {
		return iContactMapper.getIdByName(name);
	}

	@Override
	public Contact getContactById(int id) {
		return iContactMapper.getContactById(id);
	}

	@Override
	public int getContactCount(HashMap<String, Object> searchMap) {
		return iContactMapper.getContactCount(searchMap);
	}
	
}
